<!doctype html>
<html lang="{{ config('app.locale') }}">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1, min-scale=1, user-scalable=no">
  <meta name="_token" content="{{ csrf_token() }}"/>


  <script type="text/javascript" src="https://static-app.97kid.com/wx/js/zepto.min.js"></script>

  <link href="{{env('CDN_RESOURCE')}}/css/mobile/mobile.css?v={{config('app.version')}}" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="https://res.wx.qq.com/open/libs/weuijs/1.1.2/weui.min.js"></script>
  <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css">


  <script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/Zepto_fx_methods.js"></script>
  <script type="text/javascript" src="{{env('CDN_RESOURCE')}}/js/mobile/login.js"></script>
  <script type="text/javascript">window.CDN_RESOURCE = "{{env('CDN_RESOURCE')}}"</script>
  <title>Qkids久趣英语</title>

</head>
<body>


<div class="wrapper">
  <div class="payment-result">

    <div class="spinner" id="spinner">
      <div class="double-bounce1"></div>
      <div class="double-bounce2"></div>
    </div>
    <div class="ok-big-icon icon " id="okIcon"></div>
    <div class="wait-big-icon icon " id="waitIcon"></div>
    <div class="error-big-icon icon" id="errorIcon"></div>

    <h1 style="display: none;" class="verify-hint" id="successHint">支付成功</h1>
    <h1 style="display: none;" class="verify-hint" id="waitHint">支付结果正在确认。若有疑问，请联系客服</h1>
    <h1 style="display: none;" class="verify-hint" id="errorHint">支付失败,请返回重新支付。若有疑问，请联系客服</h1>
  </div>

  <div class="qr-code" style="display: block;text-align: center;">
    <div style="font-size: 16px;font-weight: bold;">重要！！！关注公众号才能上课。</div>
    <img id="qrcode" style="margin-left: 0;" src="{{env('CDN_RESOURCE')}}/img/mobile/qrcode.png"/>
    <div style="font-size: 14px;">长按扫描二维码关注【久趣英语服务号】</div>
  </div>

  <div class="order-detail" style="background-color: transparent;">
    <div class="header">订单详情</div>
    <div class="detail-item">
      <span>订购商品 : </span> <span id="order-title"></span>
    </div>

    <div class="detail-item">
      <span>订单总额 : </span> <span> ¥ {{$planDetail['total']}}</span>
    </div>

    <div class="detail-item">
      <span>使用说明 : </span> <span>详情咨询公众号【久趣英语服务号】</span>
    </div>
    @if($campUrl != '')
      <a href="{{$campUrl}}">
        <div class="reg-btn blue-btn">返回活动</div>
      </a>
    @endif
  </div>


</div>


<div class="footer">

  <div class="icon-links">
    <div class="logo-blue"></div>
  </div>

  <div class="email">
    <div class="header">企业邮箱</div>
    <div class="text">service@qkids.cn</div>
  </div>

  <div class="copy-right">
    <span>Copyright @2017-2018 Qkids All Rights Reserved</span>
    <span>闽ICP备12021838号-3</span>
  </div>

</div>

</body>
</html>


<script type="text/javascript">


  (function ($) {

    $(function () {

      var campUrl = utils.getUrlParam('campUrl');
      if (campUrl && campUrl.indexOf('summer3s') > -1) {
        $('#qrcode').attr('src', CDN_RESOURCE + '/mobile/campaign/summer/img/wechat_qr_3.jpg')
        typeof utils.setBackUrl === "function" && utils.setBackUrl(utils.getUrlParam('campUrl'))
      } else if (campUrl && campUrl.indexOf('summer2s') > -1) {
        $('#qrcode').attr('src', CDN_RESOURCE + '/mobile/campaign/summer/img/wechat_qr_3.jpg')
        typeof utils.setBackUrl === "function" && utils.setBackUrl(utils.getUrlParam('campUrl'))
      } else if (campUrl && campUrl.indexOf('summers') > -1) {
        $('#qrcode').attr('src', CDN_RESOURCE + '/mobile/campaign/summer/img/wechat_qr_2.png')
        typeof utils.setBackUrl === "function" && utils.setBackUrl(utils.getUrlParam('campUrl'))
      } else if (campUrl && campUrl.indexOf('summer') > -1) {
        $('#qrcode').attr('src', CDN_RESOURCE + '/mobile/campaign/summer/img/wechat_qr.png')
        typeof utils.setBackUrl === "function" && utils.setBackUrl(utils.getUrlParam('campUrl'))
      }  else if (campUrl && campUrl.indexOf('insect') > -1) {
        $('#qrcode').attr('src', CDN_RESOURCE + '/mobile/campaign/insect/img/wechat_qr.png')
        typeof utils.setBackUrl === "function" && utils.setBackUrl(utils.getUrlParam('campUrl'))
      }

      var account = new Account();
      // 验证订单， 是否已经支付
      account.ajax({
        type: 'GET',
        path: "{{$path}}",
        success: function (result) {
          if (typeof(result.status) !== 'undefined' && (result.status === 20 || result.status === 40)) {
            $('#spinner').hide()
            $('#okIcon').show()
            $('#successHint').show()
            $('.qr-code').show()
            $('#order-title').text(result.title.replace('订单:', ''))
          } else if (typeof(result.status) !== 'undefined' && result.status === 10) {
            $('#spinner').hide()
            $('#waitIcon').show()
            $('#waitHint').show()
            $('.qr-code').show()
            $('#order-title').text(result.title.replace('订单:', ''))
          } else {
            $('#spinner').hide()
            $('#errorIcon').show()
            $('#errorHint').show()
          }
        },
        error: function (err) {
          $('#spinner').hide()
          $('#errorIcon').show()
          $('#errorHint').show()
          $.toastAlert(err, 2)
        }
      })

      {{--var campUrl = '{{$campUrl}}';--}}
      {{--if (campUrl) {--}}
      {{--setTimeout(function () {--}}
      {{--window.location.href = campUrl;--}}
      {{--}, 5000)--}}
      {{--}--}}

    })

  })(window.Zepto)


</script>

